<style>
    .ranking {
        width: 24px;
        margin-left: 8px;
        height: 24px;
    }
</style>
<h3 class="page-title">
    字典管理
</h3>
<div class="table" ng-show="!grid.edit">
    <div style="overflow: auto">
       
        <div class="col-md-3 portlet">
            <div class="portlet-title" style="width: 95%;">
                <button class="btn btn-success title-action" ng-click="addCodeType();" tabindex="0">
					<i class="fa fa-plus"></i> 新增字典类型
				</button>
                <a href="javascript:void(0);"  ng-show="codeType.canDelete == 1 " class="title-operation"  ng-click="updateCodeType();">修改</a>
                <a href="javascript:void(0);"  ng-show="codeType.canDelete == 1 " class="title-operation"  ng-click="deleteCodeType();">删除</a>

            </div>

            <div class="portlet-body" style="max-height:685px;overflow-y: auto">
                <div class="ztree" id='codeTree1'></div>
            </div>
        </div>
        <div class="col-md-9 portlet">

            <div class="portlet-title">
            	<button class="btn btn-success title-action" ng-click="grid.add();" tabindex="0"  ng-show="codeType.canDelete == 1 ">
					<i class="fa fa-plus"></i> 新增字典
				</button>
            </div>

            <div class="portlet-body">
                <table ed-grid="grid" class="table table-striped table-bordered table-advance table-hover"
                       ed-url="code/query.do" ed-model="code">
                    <thead>
                    <tr>
                        <th ed-data="codeName">字典名称</th>
                        <th ed-data="codeValue">字典值</th>
                        <th ed-data="codeType">字典类型</th>
                        <th ed-data="codeTypeName">类型名称</th>
                        <th width="200px">操作</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="portlet light bordered edit" ng-show="grid.edit">
    <div class="caption">
        <i class="icon-equalizer font-red-sunglo"></i>
        <span class="caption-subject font-red-sunglo bold uppercase">编辑</span>
    </div>
    <div class="actions" style="float: right;margin-top: -20px;">
        <a class="btn btn-circle btn-icon-only btn-default" href="javascript:;" ng-click="grid.cancel();">
            <i class="icon-action-undo"></i>
        </a>
    </div>
    <div class="portlet-body form">
        <form action="#" class="form-horizontal" w5c-form-validate name="validateForm">
            <div class="form-body">
                <div class="form-group" ng-show="showCodeType">
                    <label class="col-md-3 control-label">上级字典</label>
                    <div class="col-md-4">
                        <div ed-combotree
                             data-options="idField: 'codeId', textField: 'codeName', parentIdField: 'parentCodeId'"
                             ng-model="model.parentCodeId" ed-data="codeTypes" placeholder="请选择"></div>
                        <!--</div>-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">字典名称</label>

                    <div class="col-md-4">
                        <input class="form-control" type="text" ng-model="model.codeName" name="codeName" required >
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">字典值</label>

                    <div class="col-md-4">
                        <input class="form-control" type="text" ng-model="model.codeValue" name="codeValue" required >
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">能否编辑</label>

                    <div class="col-md-4">
                        <select  class="form-control" ng-model="model.canDelete" required >
                            <option value="0">否</option>
                            <option value="1">能</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">字典描述</label>

                    <div class="col-md-4">
                        <textarea class="form-control" rows="3" ng-model="model.codeAlias"></textarea>
                    </div>
                </div>

            </div>
            <div class="form-actions">
                <div class="row">
                    <div class="caption col-md-offset-3 col-md-4">
                        <button type="button" class="btn" w5c-form-submit="grid.save()"><i class="fa fa-save"></i> 保存
                        </button>
                        <button type="button" class="btn" ng-click="grid.cancel();"><i class="fa fa-times"></i>
                            取消
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>




